<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Swift_File</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Swift_File</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Swift File stream abstraction layer</p>
<p class="description"><p>Reads bytes from a file</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Chris Corbyn &lt;<a href="mailto:chris@w3style.co.uk">chris@w3style.co.uk</a>&gt;</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_Swift---File.php.html">/Swift/File.php</a> (line <span class="field">22</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
																																																<div class="var-title">
					<span class="var-type">resource</span>
					<a href="#$handle" title="details" class="var-name">$handle</a>
				</div>
																<div class="var-title">
					<span class="var-type">boolean</span>
					<a href="#$magic_quotes" title="details" class="var-name">$magic_quotes</a>
				</div>
																<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$name" title="details" class="var-name">$name</a>
				</div>
																<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$path" title="details" class="var-name">$path</a>
				</div>
											</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																																																												
												<div class="method-definition">
											<span class="method-result">Swift_File</span>
										<a href="#Swift_File" title="details" class="method-name">Swift_File</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#close" title="details" class="method-name">close</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#createHandle" title="details" class="method-name">createHandle</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#EOF" title="details" class="method-name">EOF</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getByte" title="details" class="method-name">getByte</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getFileName" title="details" class="method-name">getFileName</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getPath" title="details" class="method-name">getPath</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">int</span>
										<a href="#length" title="details" class="method-name">length</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#read" title="details" class="method-name">read</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$bytes</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$unquote</span> = <span class="var-default">true</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#readFull" title="details" class="method-name">readFull</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#readln" title="details" class="method-name">readln</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#reset" title="details" class="method-name">reset</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#setPath" title="details" class="method-name">setPath</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
									</div>
								</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$handle" id="$handle"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">resource</span>
			<span class="var-name">$handle</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">38</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The resource returned by fopen() against the path</p>
	
	
		
		

</div>
<a name="var$magic_quotes" id="$magic_quotes"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">boolean</span>
			<span class="var-name">$magic_quotes</span>
			 = <span class="var-default"> false</span>			(line <span class="line-number">43</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The status of magic_quotes in php.ini</p>
	
	
		
		

</div>
<a name="var$name" id="$name"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$name</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">33</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The name of the file</p>
	
	
		
		

</div>
<a name="var$path" id="$path"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$path</span>
			 = <span class="var-default"> null</span>			(line <span class="line-number">28</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The accessible path to the file</p>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>

<a name="methodSwift_File" id="Swift_File"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">Constructor Swift_File</span> (line <span class="line-number">50</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Swift_FileException If the file cannot be found</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Swift_File</span>
		<span class="method-name">
			Swift_File
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$path</span><span class="var-description">: The path the the file</span>			</li>
				</ul>
		
			
	</div>
<a name="methodclose" id="close"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">close</span> (line <span class="line-number">197</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Close the open handle on the file</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Swift_FileException If the file cannot be read</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			close
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodcreateHandle" id="createHandle"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">createHandle</span> (line <span class="line-number">99</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Establish an open file handle on the file if the file is not yet opened</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Swift_FileException If the file cannot be opened for reading</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			createHandle
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodEOF" id="EOF"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">EOF</span> (line <span class="line-number">116</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Check if the pointer as at the end of the file</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Swift_FileException If the file cannot be read</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			EOF
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetByte" id="getByte"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getByte</span> (line <span class="line-number">127</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get a single byte from the file</p>
<p class="description"><p>Returns false past EOF</p></p>
	<ul class="tags">
				<li><span class="field">throws:</span> Swift_FileException If the file cannot be read</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getByte
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetFileName" id="getFileName"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getFileName</span> (line <span class="line-number">84</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the name of the file without it's full path</p>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getFileName
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetPath" id="getPath"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getPath</span> (line <span class="line-number">76</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the path to the file</p>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getPath
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodlength" id="length"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">length</span> (line <span class="line-number">189</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the size of the file in bytes</p>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			length
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodread" id="read"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">read</span> (line <span class="line-number">171</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Read a given number of bytes from the file</p>
<p class="description"><p>Returns false past EOF</p></p>
	<ul class="tags">
				<li><span class="field">throws:</span> Swift_FileException If the file cannot be read</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			read
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$bytes</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$unquote</span> = <span class="var-default">true</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"></span>
				<span class="var-name">$bytes</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$unquote</span>			</li>
				</ul>
		
			
	</div>
<a name="methodreadFull" id="readFull"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">readFull</span> (line <span class="line-number">157</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the entire file contents as a string</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Swift_FileException If the file cannot be read</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			readFull
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodreadln" id="readln"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">readln</span> (line <span class="line-number">138</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Read one full line from the file including the line ending</p>
<p class="description"><p>Returns false past EOF</p></p>
	<ul class="tags">
				<li><span class="field">throws:</span> Swift_FileException If the file cannot be read</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			readln
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodreset" id="reset"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">reset</span> (line <span class="line-number">206</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Reset the file pointer back to zero</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			reset
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodsetPath" id="setPath"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">setPath</span> (line <span class="line-number">60</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Set the path to the file</p>
	<ul class="tags">
				<li><span class="field">throws:</span> Swift_FileException If the file cannot be found</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setPath
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$path</span><span class="var-description">: The path to the file</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Wed, 26 Mar 2008 20:33:47 +1100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.1</a>
	</p>
	</div></body>
</html>